<?php include "counter2.php";

// $self_url = "http://" . $HTTP_HOST . $REQUEST_URI;
// $self_url = preg_replace("/\?.*/", "", $self_url);
 $name = $counter->get_input('name', '', 'get');
 $current_email = $counter->get_input('current_email', '', 'get');
 $city = $counter->get_input('city', '', 'get');
 $previous_email = $counter->get_input('previous_email', '', 'get');
 $state = $counter->get_input('state', '', 'get');
 $country = $counter->get_input('country', '', 'get');
 $ctl_skipcheck = $counter->get_input('ctl_skipcheck', '', 'get');
 $request = $counter->get_input('request', '', 'get');

pagestart();
print "<html>";
pagehead(_("Lost Key?"));
print "<body bgcolor=\"white\">";
pagetop(_("Lost Key?"));

#  if ($ctl_msg) {
	# note - if this is a span rather than a div, centering does not work
#	print "<p><div class=\"message\">$ctl_msg</div>\n";
#  }

iamashowpage();
showmessage();

print "\n<p>\n" .
_("Don't have your old email account any more? Don't have the key? Fill out this form and we'll take care of the request shortly.") . "\n</p>\n" .
_("This form causes an email to be sent to a group of people who need to do some database research by hand. Usually one of them will respond within a week. Please wait for an answer and don't create a new registration unless told so by the people of the lost key request group. Normally spoken chances are high that they will be able to recover your registration.");

print "<form method=\"POST\" action=\"/cgi-bin/lost-key.cgi\">\n" .
  "<input type=\"hidden\" name=\"ctl_url\" value=\"$_SESSION[showpage]\">\n" .
  "<table border=\"0\">\n" .
    "<tr>\n" .
      "<td align=\"right\"><div align=\"right\"><p><b>" . _("Name") . "</b></div></td>\n" .
      "<td><div align=\"left\"><p><input type=\"text\" name=\"name\" size=\"20\" value=\"$name\"></div></td>\n" .
      "<td align=\"right\"><div align=\"right\"><p><b>" . _("Current E-Mail Address") . "</b></div></td>\n" . 
      "<td><div align=\"left\"><p><input type=\"text\" name=\"current_email\" size=\"20\" value=\"$current_email\"></div></td>\n" .
    "</tr>\n";
print "<tr>\n" .
      "<td align=\"right\"><div align=\"right\"><p>" . _("City") . "</div></td>\n" .
      "<td><div align=\"left\"><p><input type=\"text\" name=\"city\" size=\"20\"value=\"$city\"></div></td>" .
      "<td align=\"right\"><b>" . _("Previous E-Mail Address") . "</b></td>\n" .
      "<td><input type=\"text\" name=\"previous_email\" size=\"20\" value=\"$previous_email\"></td>\n" .
    "</tr>\n";
print "<tr>\n" .
      "<td align=\"right\"><div align=\"right\"><p>" . _("State/province/department") ."</div></td>\n" .
      "<td><div align=\"left\"><p><input type=\"text\" name=\"state\" size=\"20\" value=\"$state\"></div></td>\n" .
      "<td align=\"right\"></td>\n" .
      "<td></td>\n" .
    "</tr>\n";
print "<tr>\n" .
      "<td align=\"right\"><div align=\"right\"><p>" . _("Country") . "</div></td>\n" .
      "<td><input type=\"text\" name=\"country\" size=\"20\" value=\"$country\"></td>\n" .
      "<td align=\"right\"></td>\n" .
      "<td></td>\n" .
    "</tr>\n";
// if ($ctl_msg) {
if ($_SESSION[message]) {
    print "<tr>\n" .
	"<td>&nbsp;<td colspan=\"3\">\n" .
	"<input type=\"checkbox\" name=\"ctl_skipcheck\" value=\"skip\">\n" .
	_("Send mail even though there are errors in the data") .
    "\n</tr>\n" ;
}
    print "<tr>\n" .
      "<td align=\"right\" colspan=\"4\"><div align=\"left\">\n" .
      _("The items in <b>bold</b> <em>must</em> be filled in.") .
      "\n<p>\n" . _("What do you want us to do") . "?</p>\n" .
      "</div>\n<div align=\"left\"><p><textarea rows=\"6\" name=\"request\" cols=\"52\">$request</textarea></div></td>\n" .
    "</tr>\n" .
  "</table>\n" .
  "<input type=\"submit\" value=\"" . _("Submit"). "\" name=\"B1\"><input type=\"reset\" value=\"" . _("Reset") . "\" name=\"B2\">\n" .
"</form>\n";

print "<p>\n" . _("To get more local service, look first in the") .
" <a href=\"reports/maintainers.php\">" . _("maintainers list") . "</a> " . _("to see if there's a specific person taking care of your country.") . "<br>\n" .
_("If there isn't, write to") . emailCloaking("lost-key@counter.li.org") . _("which is the same people as above.") . "\n";

print "<p>" . _("Someone should respond shortly.") . "</p>\n";

pagebottom("yes");
print "</body>\n" .
"</html>";

clearmessage();
?>
